package Agenda;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 *
 * @author sanford
 */
public class CriaConexao {

	public static void createDb() throws SQLException, ClassNotFoundException{
		String sql = "create database if not exists agendadb;";
		Connection conexao = SingletonConexao.getInstance().getConexao();
		PreparedStatement stmt = conexao.prepareStatement(sql);
		stmt.execute();
		stmt.execute("use agendadb;");
		stmt.execute("create table if not exists contato(id int(3) NOT NULL AUTO_INCREMENT,nome varchar(50) NOT NULL,"
				+ " email varchar(50),endereco varchar(50),telefone varchar(12),sexo varchar(1),PRIMARY KEY(id));");

	}


}